# Circular data is sent
import socket

def main():
    # create an udp socket
    udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

    while True:
        # get data from the keyboard
        send_data = input("Please enter the data you want send:")

        # if input data is "exit" or "x", just exit the program
        if send_data == "exit":
            break
        # use socket transceiver
        # udp_socket.sendto(b'-------hhhhhhh--------', ('192.168.101.18', 9000))
        udp_socket.sendto(send_data.encode("utf-8"), ("192.168.101.18", 8080))

    # close socket
    udp_socket.close()


if __name__ == "__main__":
    main()